package modelLayer;

/**
 * The Loan class defines a loan
 * @author group 6 - Stefan Patatu, Stan Cosmin Madalin, Monika Vyšniauskaitė, Larowski Michal, Njogu Alex, Cristian Moldovan
 */
public class Loan {
    private int ID;
    private String borrowDate;
    private String period;
    private String state;
    private Person p;
    private Copy c;
    
    /**
     * Create a Loan object.
     * @param borrowDate The burrow date of a loan.
     * @param period The period a dvd is lended.
     * @param state The actual state of a loan.
     * @param p Assign a Person to a loan.
     * @param d Assign a DVD to a loan.
     */
    public Loan(String borrowDate, String period, Person p, Copy c) {
       state = "ongoing";
       this.borrowDate = borrowDate;
       this.period = period;
       this.p = p;
       this.c = c;
    }
    
    /**
     * Set a given id to a loan.
     * @param incrementedID The ID of a loan.
     */
    public void setID(int incrementedID) {
        this.ID = incrementedID;
    }
    /**
     * Get the ID of a loan.
     * @param ID the ID of a loan.
     */
      public int getID() {
        return ID;
    }
    
    /**
     * Set a given state to a loan.
     * @param state The state of a loan
     */
    public void setState(String state) {
        this.state = state;
    }
    /**
     * Get the state of a loan.
     * @param state The state of a loan
     */
    public String getState() {
        return state;
    }
    
    /**
     * Set a given period to a loan.
     * @param period The period of a loan.
     */
    public void setPeriod(String period) {
        this.period = period;
    }
    /**
     * Get the period of a loan.
     * @param period The period of a loan.
     */
    public String getPeriod() {
        return period;
    }
    
    public String getBorrowDate() {
        return borrowDate;
    }
    public Person getPerson() {
        return p;
    }
    public Copy getCopy() {
        return c;
    }
}
